<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>个人主页</title>
<link rel="stylesheet" type="text/css" href="css/footer.css">
</head>

<body>
<section class="aui-flexView">
    <header class="aui-navBar aui-navBar-fixed">
        <a href="javascript:history.back(-1);" class="aui-navBar-item">
            <i class="icon icon-return" style="width:12px"></i>
        </a>
        <div class="aui-center">
            <span class="aui-center-title">性别设置</span>
        </div>
        <a href="javascript:;" class="aui-navBar-item">
            <i class="icon icon-sys"></i>
        </a>
    </header>
    <section class="aui-scrollView">
        <div class="divHeight"></div>

        <div class="ps-lt">
            <a href="javascript:select(1)">
            <div class="lt-dsb">
                <p>男</p>
                <i class="arr-right-select arr-active " index="1">√</i>
            </div></a>
            <a href="javascript:select(0)"><div class="lt-dsb ">
                <p>女</p>
                <i class="arr-right-select" index="0">√</i>
            </div></a>
        </div>
    </section>
</section>
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
    (function (doc, win) {
     var docEl = doc.documentElement,
     resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
     recalc = function () {
       var clientWidth = docEl.clientWidth;
       if (!clientWidth) return;
       docEl.style.fontSize = 100 * (clientWidth / 750) + 'px';
     };

      if (!doc.addEventListener) return;
      win.addEventListener(resizeEvt, recalc, false);
      doc.addEventListener('DOMContentLoaded', recalc, false);
    })(document, window);

    var userinfo = window.localStorage.getItem('myinfo');

    $(function(){
        if(userinfo && userinfo != 'undefine') {
            var userInfoObj = JSON.parse(userinfo);
            if(userInfoObj.sex) {
                select(1);
            } else {
                select(0);
            }
        } else {
            select(1);
        }
    })

    function select(index) { 
        $(".arr-right-select").removeClass("arr-active");
        $("i[index="+index+"]").addClass("arr-active");
        if(userinfo && userinfo != 'undefine') {
            var userInfoObj = JSON.parse(userinfo);
            userInfoObj['sex']=index==1?true:false;
            window.localStorage.setItem('myinfo',JSON.stringify(userInfoObj));
            window.localStorage.setItem('myinfoUpdate','update');
        }

    }
    

    
</script>
</body>
</html>
